<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<?php 
$this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?>
</head>
<body>
<table width="800" align="center" class="detail">
	<tr class="detail2">
   	  <td colspan="2" align="center">
        <table width="800" align="center" >
        <tr class="detail2">
          <td width="440" rowspan="4" valign="top"><img src="<?php echo base_url();?>images/logo.jpg" />&nbsp;</td>
          <td width="203"> <?php echo $default[0]->strnama_cabang?>, <?php echo date('d-m-Y')?></td>
     	  <td width="41"><a href="javascript:window.print()" onclick="location.href='../../bayar_arisan';"><img src="<?php echo base_url();?>/images/print.jpg"/></a></td>
        </tr>
        <tr>
            <td align="justify"><h3> Nama&nbsp;&nbsp;: <?php echo $default[0]->strnama_dealer?></h3></td>
            <td width="41">&nbsp;</td>
        </tr>
        <tr>
            <td><h3> Upline&nbsp;&nbsp;: <?php echo $default[0]->strnama_upline?></h3></td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td> <h3>Unit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <?php echo $default[0]->strnama_unit?></h3> </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2" class="detail">
              <h3>  NOTA  NO. : <?php echo $no_nota;?>     </h3>   	</td>
                <td>&nbsp;</td>
        </tr>
        <tr align="center">
            <td colspan="2" class="judul" align="center">
			<h3>
                <?php
				if ($default[0]->intid_jpenjualan==1)
				{
					$judul ="Reguler";
				} else if ($default[0]->intid_jpenjualan==2)
				{
					$judul ="Hut";
				} else if ($default[0]->intid_jpenjualan==3)
				{
					$judul ="Challenge";
				} else if ($default[0]->intid_jpenjualan==4)
				{
					$judul ="Trade In";
				} else if ($default[0]->intid_jpenjualan==5)
				{
					$judul ="1 Free 1 HUT";
				} else if ($default[0]->intid_jpenjualan==6)
				{
					$judul ="1 Free 1";
				} else if ($default[0]->intid_jpenjualan==7)
				{
					$judul ="Netto";
				}else if ($default[0]->intid_jpenjualan==8)
				{
					$judul ="Lain-lain";
				} else if ($default[0]->intid_jpenjualan==9)
				{
					$judul ="Arisan";
				}

				?>
                 Nota Pembayaran <?php echo $judul;?><br />
                 Cicilan ke-
                 <?php 
			if($default[0]->c1==1&&$default[0]->c2==1&&$default[0]->c3==1&&$default[0]->c4==1&&$default[0]->c5==1&&$default[0]>c6==1&&$default[0]->c7==1){
			$cicilan="7";
			}else if($default[0]->c1==1&&$default[0]->c2==1&&$default[0]->c3==1&&$default[0]->c4==1&&$default[0]->c5==1&&$default[0]->c6==1){
			$cicilan="6";
			}else if($default[0]->c1==1&&$default[0]->c2==1&&$default[0]->c3==1&&$default[0]->c4==1&&$default[0]->c5==1){
			$cicilan="5";
			}else if($default[0]->c1==1&&$default[0]->c2==1&&$default[0]->c3==1&&$default[0]->c4==1){
			$cicilan="4";
			}else if($default[0]->c1==1&&$default[0]->c2==1&&$default[0]->c3==1){
			$cicilan="3";
			}else if($default[0]->c1==1&&$default[0]->c2==1) {
			$cicilan="2";
			}else if($default[0]->c1==1){ 
			$cicilan="1";
			} else {
			$cicilan="0";
			}
			echo $cicilan; ?>
			</h3>
			</td>
                <td>&nbsp;</td>
        </tr>
    </table>
    </td>
    </tr>
    <tr>
    	<td colspan="2" align="center">
        	<table width="800" border="1" align="center"  class="detail">
			<tr class="detail2">
                	<th>Banyaknya</th>
                    <th>Nama Barang</th>
                    <th>Harga</th>
                    <th>Jumlah</th>
                </tr><tr>
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <?php
                $total = 0;
				$cicilan = array("");
                foreach($default as  $d):
                      if($d->is_free == 1){
                        $harga = 0;
                      }else{
						   if ($d->intid_wilayah==1){
								$harga = $d->intharga_jawa;
								$cicilan[] = $d->intcicilan_jawa;
							}else {
								$harga = $d->intharga_luarjawa;
								$cicilan[] = $d->intcicilan_luarjawa;
							}
					  }                    
                    ?>
                <tr>
                    <td align="center"  class='style-css'><?php echo $d->intquantity?></td>
                    <td align="left"  class='style-css'><?php echo $d->strnama?></td>
                    <td  align="justify"  class='style-css'><?php echo "Rp. ".number_format($harga,2 , ',' , '.')?></td>
                    <td align="justify"  class='style-css'><?php $jumlah = $harga * $d->intquantity; echo "Rp. ".number_format($jumlah,2 , ',' , '.');
                    $total = $total + $jumlah;
                    ?></td>
                </tr>
                <?php endforeach;?>

                
                <tr>
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                	<td colspan="3" align="right" class="detail">&nbsp;Jumlah&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                    <td align="justify"><?php echo "Rp. ".number_format($total,2 , ',' , '.')?></td>
                </tr>
            </table>      </td>
    </tr>

    <tr>
<td colspan="2" align="center">
                		<table width="800" border="1" align="center" class="detail">
               <tr class="detail2">
                    <td width="170" align="center">&nbsp;</td>
                    <td width="268" align="center">&nbsp;</td>
                    <td width="114" align="left">Omset</td>
                    <td align="justify"><?php echo "Rp. ".number_format($default[0]->inttotal_omset,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">
                    <td width="170" align="center">&nbsp;</td>
                    <td width="268" align="center">&nbsp;</td>
                    <td width="114" align="left">PV</td>
                    <td><?php echo "&nbsp;&nbsp;&nbsp;&nbsp;".number_format($default[0]->intpv,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">
                    <td width="170" align="center">&nbsp;</td>
                    <td width="268" align="center">&nbsp;</td>
                    <td width="114" align="left">Cicilan</td>
                    <td align="justify"><?php 
					$cicil =0;
					for($i=0;$i <= sizeof($default);$i++){
						echo "cicilan ".$i.", ".$cicilan[$i].", ".$default[$i]->qty."<br />";
						$cicil = $cicil+($cicilan[$i]*$default[$i]->qty);
					}
					echo "Rp. ".number_format($cicil,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">
                    <td width="170" align="center">&nbsp;</td>
                    <td width="268" align="center">&nbsp;</td>
                    <td width="114" align="left">Komisi 20%</td>
                    <td align="justify"><?php echo "Rp. ".number_format($default[0]->intkomisi20,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">
                    <td width="170" align="center">&nbsp;</td>
                    <td width="268" align="center">&nbsp;</td>
                    <td width="114" align="left">Komisi 10%</td>
                    <td align="justify"><?php echo "Rp. ".number_format($default[0]->intkomisi10,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td align="left">Cash</td>
                    <td align="justify"><?php 
					$cash = $cicil - $default[0]->intkomisi20 - $default[0]->intkomisi10;
					echo "Rp. ".number_format($cash,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">  
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td align="left">Debit</td>
                    <td align="justify"><?php echo "Rp. ".number_format($default[0]->intdebit,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td align="left">Credit Card</td>
                    <td align="justify"><?php echo "Rp. ".number_format($default[0]->intkkredit,2 , ',' , '.')?></td>
                </tr>
                <tr class="detail2">
                	<td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td align="left">Sisa</td>
                    <td align="justify"><?php echo "Rp. ".number_format($default[0]->intsisa,2 , ',' , '.')?></td>
                </tr>
        </table>
      </td>
       </tr>
                <tr>
                	<td colspan="2" align="center">
              	<table width="800" align="center" class="detail">
                        <tr class="detail2">
                          <td width="229" colspan="4" align="center">GUDANG</td>
                          <td width="229" colspan="4" align="center">PEMBELI</td>
                          <td width="229" colspan="4" align="center">KASIR</td>
                        </tr>
                        <tr>
                          <td width="229" colspan="4" align="right">&nbsp;</td>
                          <td width="229" colspan="4" align="right">&nbsp;</td>
                          <td width="229" colspan="4" align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td width="229" colspan="4" align="right">&nbsp;</td>
                          <td width="229" colspan="4" align="right">&nbsp;</td>
                          <td width="229" colspan="4" align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td width="230" colspan="4" align="center">(....................)</td>
                          <td width="230" colspan="4" align="center">(....................)</td>
                          <td width="230" colspan="4" align="center">(....................)</td>
                        </tr>
                      </table>      </td>
                </tr>

</table>
</body>
</html>